﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Honestysoft.Financing.Model;

namespace Honestysoft.Financing.WebUI.Module.Project
{
    /// <summary>
    /// 得到动态拆分项目的金额信息
    /// </summary>
    public class GetDymProjectAmount : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string projectCode = context.Request.Params["Code"];
            BD_Project project = new Honestysoft.Financing.BusinessLogic.Project("").GetDymSplitProjectByCode(projectCode);
            if (project != null)
            {
                context.Response.Write(project.FinInvestment.ToString("0.00") + "|" + project.Investment.ToString("0.00") + "|" + project.TotalCapitalAmount.ToString("0.00"));
            }
            else
            {
                context.Response.Write("0");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}